const tool = {
    throttle(fn, delay = 100) {
        let timer = null
        return data => {
            clearTimeout(timer)
            timer = setTimeout(() => {
                fn()
            }, delay)
        }
    }
};

export default tool;